/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author duongnv
 */
@Entity
@Table(name = "TBL_TRANSACTIONS", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TblTransactions.findAll", query = "SELECT t FROM TblTransactions t"),
    @NamedQuery(name = "TblTransactions.findById", query = "SELECT t FROM TblTransactions t WHERE t.id = :id"),
    @NamedQuery(name = "TblTransactions.findByUserId", query = "SELECT t FROM TblTransactions t WHERE t.userId = :userId"),
    @NamedQuery(name = "TblTransactions.findByTransType", query = "SELECT t FROM TblTransactions t WHERE t.transType = :transType"),
    @NamedQuery(name = "TblTransactions.findByCpTransId", query = "SELECT t FROM TblTransactions t WHERE t.cpTransId = :cpTransId"),
    @NamedQuery(name = "TblTransactions.findByTransId", query = "SELECT t FROM TblTransactions t WHERE t.transId = :transId"),
    @NamedQuery(name = "TblTransactions.findByStartedTime", query = "SELECT t FROM TblTransactions t WHERE t.startedTime = :startedTime"),
    @NamedQuery(name = "TblTransactions.findByLastUpdatedTime", query = "SELECT t FROM TblTransactions t WHERE t.lastUpdatedTime = :lastUpdatedTime"),
    @NamedQuery(name = "TblTransactions.findByTransStatus", query = "SELECT t FROM TblTransactions t WHERE t.transStatus = :transStatus"),
    @NamedQuery(name = "TblTransactions.findByNumPreviousTrans", query = "SELECT t FROM TblTransactions t WHERE t.numPreviousTrans = :numPreviousTrans"),
    @NamedQuery(name = "TblTransactions.findByOriginIdTrans", query = "SELECT t FROM TblTransactions t WHERE t.originIdTrans = :originIdTrans"),
    @NamedQuery(name = "TblTransactions.findBySerialCard", query = "SELECT t FROM TblTransactions t WHERE t.serialCard = :serialCard"),
    @NamedQuery(name = "TblTransactions.findByPinCard", query = "SELECT t FROM TblTransactions t WHERE t.pinCard = :pinCard"),
    @NamedQuery(name = "TblTransactions.findByAmount", query = "SELECT t FROM TblTransactions t WHERE t.amount = :amount"),
    @NamedQuery(name = "TblTransactions.findByErrCode", query = "SELECT t FROM TblTransactions t WHERE t.errCode = :errCode"),
    @NamedQuery(name = "TblTransactions.findByErrDesc", query = "SELECT t FROM TblTransactions t WHERE t.errDesc = :errDesc"),
    @NamedQuery(name = "TblTransactions.findByTransCanRetry", query = "SELECT t FROM TblTransactions t WHERE t.transCanRetry = :transCanRetry"),
    @NamedQuery(name = "TblTransactions.findByResponseTime", query = "SELECT t FROM TblTransactions t WHERE t.responseTime = :responseTime"),
    @NamedQuery(name = "TblTransactions.findByGate", query = "SELECT t FROM TblTransactions t WHERE t.gate = :gate")})
public class TblTransactions implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private BigDecimal id;
    @Size(max = 22)
    @Column(name = "USER_ID")
    private String userId;
    @Column(name = "TRANS_TYPE")
    private BigInteger transType;
    @Size(max = 32)
    @Column(name = "CP_TRANS_ID")
    private String cpTransId;
    @Size(max = 32)
    @Column(name = "TRANS_ID")
    private String transId;
    @Column(name = "STARTED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startedTime;
    @Column(name = "LAST_UPDATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedTime;
    @Column(name = "TRANS_STATUS")
    private BigInteger transStatus;
    @Column(name = "NUM_PREVIOUS_TRANS")
    private BigInteger numPreviousTrans;
    @Size(max = 22)
    @Column(name = "ORIGIN_ID_TRANS")
    private String originIdTrans;
    @Size(max = 32)
    @Column(name = "SERIAL_CARD")
    private String serialCard;
    @Size(max = 32)
    @Column(name = "PIN_CARD")
    private String pinCard;
    @Size(max = 22)
    @Column(name = "AMOUNT")
    private String amount;
    @Size(max = 15)
    @Column(name = "ERR_CODE")
    private String errCode;
    @Size(max = 100)
    @Column(name = "ERR_DESC")
    private String errDesc;
    @Column(name = "TRANS_CAN_RETRY")
    private BigInteger transCanRetry;
    @Size(max = 22)
    @Column(name = "RESPONSE_TIME")
    private String responseTime;
    @Size(max = 10)
    @Column(name = "GATE")
    private String gate;

    public TblTransactions() {
    }

    public TblTransactions(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public BigInteger getTransType() {
        return transType;
    }

    public void setTransType(BigInteger transType) {
        this.transType = transType;
    }

    public String getCpTransId() {
        return cpTransId;
    }

    public void setCpTransId(String cpTransId) {
        this.cpTransId = cpTransId;
    }

    public String getTransId() {
        return transId;
    }

    public void setTransId(String transId) {
        this.transId = transId;
    }

    public Date getStartedTime() {
        return startedTime;
    }

    public void setStartedTime(Date startedTime) {
        this.startedTime = startedTime;
    }

    public Date getLastUpdatedTime() {
        return lastUpdatedTime;
    }

    public void setLastUpdatedTime(Date lastUpdatedTime) {
        this.lastUpdatedTime = lastUpdatedTime;
    }

    public BigInteger getTransStatus() {
        return transStatus;
    }

    public void setTransStatus(BigInteger transStatus) {
        this.transStatus = transStatus;
    }

    public BigInteger getNumPreviousTrans() {
        return numPreviousTrans;
    }

    public void setNumPreviousTrans(BigInteger numPreviousTrans) {
        this.numPreviousTrans = numPreviousTrans;
    }

    public String getOriginIdTrans() {
        return originIdTrans;
    }

    public void setOriginIdTrans(String originIdTrans) {
        this.originIdTrans = originIdTrans;
    }

    public String getSerialCard() {
        return serialCard;
    }

    public void setSerialCard(String serialCard) {
        this.serialCard = serialCard;
    }

    public String getPinCard() {
        return pinCard;
    }

    public void setPinCard(String pinCard) {
        this.pinCard = pinCard;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getErrDesc() {
        return errDesc;
    }

    public void setErrDesc(String errDesc) {
        this.errDesc = errDesc;
    }

    public BigInteger getTransCanRetry() {
        return transCanRetry;
    }

    public void setTransCanRetry(BigInteger transCanRetry) {
        this.transCanRetry = transCanRetry;
    }

    public String getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(String responseTime) {
        this.responseTime = responseTime;
    }

    public String getGate() {
        return gate;
    }

    public void setGate(String gate) {
        this.gate = gate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblTransactions)) {
            return false;
        }
        TblTransactions other = (TblTransactions) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.TblTransactions[ id=" + id + " ]";
    }
    
}
